<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns information from the message queue data structure</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.msg-set-queue.html">« msg_set_queue</a></li>
      <li style="float: right;"><a href="function.sem-acquire.html">sem_acquire »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.sem.html">Semaphore 函数</a></li>
    <li>Returns information from the message queue data structure</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.msg-stat-queue" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">msg_stat_queue</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">msg_stat_queue</span> &mdash; <span class="dc-title">Returns information from the message queue data structure</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.msg-stat-queue-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>msg_stat_queue</strong></span>(<span class="methodparam"><span class="type"><a href="class.sysvmessagequeue.html" class="type SysvMessageQueue">SysvMessageQueue</a></span> <code class="parameter">$queue</code></span>): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>msg_stat_queue()</strong></span> returns the message queue meta data
   for the message queue specified by the <code class="parameter">queue</code>.
   This is useful, for example, to determine which process sent the message
   that was just received.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.msg-stat-queue-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">queue</code></dt>

     <dd>

      <p class="para">
       The message queue.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.msg-stat-queue-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   On success, the return value is an array whose keys and values have the following
   meanings:
   <table class="doctable table">
    <caption><strong>Array structure for msg_stat_queue</strong></caption>
    
     <tbody class="tbody">
      <tr>
       <td><code class="literal">msg_perm.uid</code></td>
       <td>
        The uid of the owner of the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_perm.gid</code></td>
       <td>
        The gid of the owner of the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_perm.mode</code></td>
       <td>
        The file access mode of the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_stime</code></td>
       <td>
        The time that the last message was sent to the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_rtime</code></td>
       <td>
        The time that the last message was received from the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_ctime</code></td>
       <td>
        The time that the queue was last changed.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_qnum</code></td>
       <td>
        The number of messages waiting to be read from the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_qbytes</code></td>
       <td>
        The maximum number of bytes allowed in one message queue. On
        Linux, this value may be read and modified via
        <var class="filename">/proc/sys/kernel/msgmnb</var>.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_lspid</code></td>
       <td>
        The pid of the process that sent the last message to the queue.
       </td>
      </tr>

      <tr>
       <td><code class="literal">msg_lrpid</code></td>
       <td>
        The pid of the process that received the last message from the queue.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
  <p class="para">
   Returns <strong><code>false</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.msg-stat-queue-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">queue</code> expects a <span class="classname"><a href="class.sysvmessagequeue.html" class="classname">SysvMessageQueue</a></span>
        instance now; previously, a <span class="type">resource</span> was expected.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.msg-stat-queue-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.msg-remove-queue.html" class="function" rel="rdfs-seeAlso">msg_remove_queue()</a> - Destroy a message queue</span></li>
    <li class="member"><span class="function"><a href="function.msg-receive.html" class="function" rel="rdfs-seeAlso">msg_receive()</a> - Receive a message from a message queue</span></li>
    <li class="member"><span class="function"><a href="function.msg-get-queue.html" class="function" rel="rdfs-seeAlso">msg_get_queue()</a> - Create or attach to a message queue</span></li>
    <li class="member"><span class="function"><a href="function.msg-set-queue.html" class="function" rel="rdfs-seeAlso">msg_set_queue()</a> - Set information in the message queue data structure</span></li>
   </ul>
  </p>
 </div>
  

</div></div></div></body></html>